package com.generic.demo4;

/**
 * @ClassName MyArrayListTest
 * @Description TODO
 * @Author Kx
 * @Date 2025/3/26 19:57
 * @Version 1.0
 */
public class MyArrayListTest {
    public static void main(String[] args) {
        MyArrayList<String> list = new MyArrayList<>();

        list.add("hello");
        list.add("world");

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }

        list.remove(0);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }

        System.out.println(list.get(0));

        list.set(0,"java");

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }

        System.out.println(list.isEmpty());

        String string = list.toString();
        System.out.println(string);
    }
}
